package com.huqu.entities;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;

import org.apache.commons.codec.net.URLCodec;
import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.web.servlet.tags.EscapeBodyTag;

import com.huqu.basedao.QbMapping;
import com.huqu.utils.ApplicationConstant;
import com.huqu.utils.ApplicationHelper;

public class N300 implements Serializable {

	private static final long serialVersionUID = 5317396314900110366L;
	
	@QbMapping(name = "idtheloai", typeMapping = Types.INTEGER)
	private int idtheloai;
	private String urltheloai;
	
	@QbMapping(name = "idbaiviet", typeMapping = Types.INTEGER)
	private int idbaiviet;
	
	private String md5baiviet;
	
	@QbMapping(name = "url", typeMapping = Types.CHAR)
	private String url;
	
	@QbMapping(name = "tieude", typeMapping = Types.CHAR)
	private String tieude;
	private String tieude_vi;
	private String tieude_en;
	
	@QbMapping(name = "tomtat", typeMapping = Types.CHAR)
	private String tomtat;
	private String tomtat_vi;
	private String tomtat_en;
	
	@QbMapping(name = "noidung", typeMapping = Types.CHAR)
	private String noidung;
	private String noidung_vi;
	private String noidung_en;
	
	@QbMapping(name = "hinhanh", typeMapping = Types.CHAR)
	private String hinhanh;
	private String hinhanh_name;
	
	@QbMapping(name = "nguoitao", typeMapping = Types.INTEGER)
	private int nguoitao;
	
	@QbMapping(name = "nguoicapnhat", typeMapping = Types.INTEGER)
	private int nguoicapnhat;
	
	@QbMapping(name = "daxoa", typeMapping = Types.INTEGER)
	private int daxoa;
	
	@QbMapping(name = "kiemduyet", typeMapping = Types.INTEGER)
	private int kiemduyet;
	
	@QbMapping(name = "uutien", typeMapping = Types.INTEGER)
	private int uutien;
	
	@QbMapping(name = "luotxem", typeMapping = Types.INTEGER)
	private int luotxem;
	
	@QbMapping(name = "totalrow", typeMapping = Types.INTEGER)
	private int totalrow;
	
	@QbMapping(name = "tgtao", typeMapping = Types.TIMESTAMP )
	private Timestamp tgtao;
	
	@QbMapping(name = "tgcapnhat", typeMapping = Types.TIMESTAMP)
	private Timestamp tgcapnhat;
	
	

//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
	public int getIdtheloai() {
		return idtheloai;
	}

	public void setIdtheloai(int idtheloai) {
		this.idtheloai = idtheloai;
	}

	public String getUrltheloai() {
		if(idtheloai==9){urltheloai="nganh-nghe";}
		else if(idtheloai==10){urltheloai="tuyen-sinh";}
		else if(idtheloai==11){urltheloai="huong-nghiep";}
		else if(idtheloai==12){urltheloai="tuyen-sinh";}
		return urltheloai;
	}

	public void setUrltheloai(String urltheloai) {
		this.urltheloai = urltheloai;
	}

	public int getIdbaiviet() {
		return idbaiviet;
	}

	public void setIdbaiviet(int idbaiviet) {
		this.idbaiviet = idbaiviet;
	}

	public String getTieude() {
		return tieude;
	}

	public void setTieude(String tieude) {
		this.tieude = tieude;
	}

	public String getTomtat() {
		return tomtat;
	}

	public void setTomtat(String tomtat) {
		this.tomtat = tomtat;
	}

	public String getNoidung() {
		return noidung;
	}

	public void setNoidung(String noidung) {
		this.noidung = noidung;
	}

	public String getHinhanh() {
		if(hinhanh==null){
			hinhanh=ApplicationConstant.URL_NO_IMAGE;
		}else{
			hinhanh=ApplicationConstant.URL_IMAGE_BAIVIET+hinhanh;
		}
		return hinhanh;
	}

	public void setHinhanh(String hinhanh) {
		this.hinhanh = hinhanh;
	}

	public String getHinhanh_name() {
		return hinhanh_name;
	}

	public void setHinhanh_name(String hinhanh_name) {
		this.hinhanh_name = hinhanh_name;
	}

	public int getNguoitao() {
		return nguoitao;
	}

	public void setNguoitao(int nguoitao) {
		this.nguoitao = nguoitao;
	}

	public int getNguoicapnhat() {
		return nguoicapnhat;
	}

	public void setNguoicapnhat(int nguoicapnhat) {
		this.nguoicapnhat = nguoicapnhat;
	}

	public int getDaxoa() {
		return daxoa;
	}

	public void setDaxoa(int daxoa) {
		this.daxoa = daxoa;
	}

	public int getKiemduyet() {
		return kiemduyet;
	}

	public void setKiemduyet(int kiemduyet) {
		this.kiemduyet = kiemduyet;
	}

	public int getUutien() {
		return uutien;
	}

	public void setUutien(int uutien) {
		this.uutien = uutien;
	}

	public int getLuotxem() {
		return luotxem;
	}

	public void setLuotxem(int luotxem) {
		this.luotxem = luotxem;
	}

	public int getTotalrow() {
		return totalrow;
	}

	public void setTotalrow(int totalrow) {
		this.totalrow = totalrow;
	}

	public Timestamp getTgtao() {
		return tgtao;
	}

	public void setTgtao(Timestamp tgtao) {
		this.tgtao = tgtao;
	}

	public Timestamp getTgcapnhat() {
		return tgcapnhat;
	}

	public void setTgcapnhat(Timestamp tgcapnhat) {
		this.tgcapnhat = tgcapnhat;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getMd5baiviet() {
		if(idbaiviet!=0){
			md5baiviet=ApplicationHelper.convertToMD5(String.valueOf(idbaiviet));
		}
		return md5baiviet;
	}

	public void setMd5baiviet(String md5baiviet) {
		this.md5baiviet = md5baiviet;
	}

	public String getTieude_vi() {
		return tieude_vi;
	}

	public void setTieude_vi(String tieude_vi) {
		this.tieude_vi = tieude_vi;
	}

	public String getTieude_en() {
		return tieude_en;
	}

	public void setTieude_en(String tieude_en) {
		this.tieude_en = tieude_en;
	}

	public String getTomtat_vi() {
		return tomtat_vi;
	}

	public void setTomtat_vi(String tomtat_vi) {
		this.tomtat_vi = tomtat_vi;
	}

	public String getTomtat_en() {
		return tomtat_en;
	}

	public void setTomtat_en(String tomtat_en) {
		this.tomtat_en = tomtat_en;
	}

	public String getNoidung_vi() {
		return noidung_vi;
	}

	public void setNoidung_vi(String noidung_vi) {
		this.noidung_vi = noidung_vi;
	}

	public String getNoidung_en() {
		return noidung_en;
	}

	public void setNoidung_en(String noidung_en) {
		this.noidung_en = noidung_en;
	}
	
	
}
